﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Services.Common;

namespace RSSAggregator_WebRole
{
    [DataServiceKey("PartitionKey", "RowKey")]
    public class RssLink : Microsoft.Samples.ServiceHosting.StorageClient.TableStorageEntity
    {
        public string Owner { get; set; }
        public string Link { get; set; }

        public RssLink()
        {
            this.Init();
        }

        public RssLink(string owner, string link)
        {
            this.Owner = owner;
            this.Link = link;
            Init();
        }

        private void Init()
        {
            this.PartitionKey = this.Owner;
            this.RowKey = RowKey = string.Format("{0:10}_{1}", DateTime.MaxValue.Ticks - DateTime.Now.Ticks, Guid.NewGuid());
            //this.RowKey = "laal";
        }

    }
}
